Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to output messages in JSON format #288

Merged
merged 3 commits into from
Mar 10, 2022

Conversation

azeey
Copy link
Contributor

@azeey azeey commented Jan 31, 2022

🎉 New feature

Summary

This adds a command line option --json-output to allow output in JSON format instead of Protobuf's default DebugString format. This would useful for manipulating message output with tools like jq. For example, if we wanted to extract just the x component of a Pose message, we could do

ign topic -e --json-output -t /pose_topic | jq '.position.x'

Test it

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

@azeey azeey self-assigned this Jan 31, 2022
@azeey azeey requested a review from caguero as a code owner January 31, 2022 17:21
@github-actions github-actions bot added the 🏢 edifice Ignition Edifice label Jan 31, 2022
@codecov
Copy link

codecov bot commented Jan 31, 2022

Codecov Report

Merging #288 (05d7f69) into ign-transport10 (347ff00) will decrease coverage by 0.05%.
The diff coverage is 75.00%.

Impacted file tree graph

@@                 Coverage Diff                 @@
##           ign-transport10     #288      +/-   ##
===================================================
- Coverage            89.10%   89.05%   -0.06%     
===================================================
  Files                   51       51              
  Lines                 4765     4779      +14     
===================================================
+ Hits                  4246     4256      +10     
- Misses                 519      523       +4     
Impacted Files Coverage Δ
src/cmd/ign.cc 95.31% <75.00%> (-2.13%) ⬇️
src/cmd/topic_main.cc 95.00% <75.00%> (-1.50%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 347ff00...05d7f69. Read the comment docs.

Copy link
Contributor

@nkoenig nkoenig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just minor comments.

src/cmd/ign.cc Outdated Show resolved Hide resolved
src/cmd/ign.cc Outdated Show resolved Hide resolved
src/cmd/topic_main.cc Show resolved Hide resolved
src/cmd/ign.cc Outdated Show resolved Hide resolved
Signed-off-by: Addisu Z. Taddese <[email protected]>
@azeey
Copy link
Contributor Author

azeey commented Mar 1, 2022

The windows warnings are also in the ign-transport10 branch: https://build.osrfoundation.org/job/ign_transport-ign-10-win/12/

@chapulina chapulina merged commit 8f60438 into gazebosim:ign-transport10 Mar 10, 2022
@azeey azeey deleted the json_output branch March 10, 2022 22:35
@osrf-triage
Copy link

This pull request has been mentioned on Gazebo Community. There might be relevant details there:

https://community.gazebosim.org/t/new-ignition-releases-2022-03-25-fortress-edifice-citadel/1343/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏢 edifice Ignition Edifice
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants